<?php

/*
 * This is for news operations.
 */

include '../config.php';
echo $action = $_POST['action'];

switch ($action) {
    case 'new':             # create new news entry.
        mysql_query("insert into salus_news(sr,title,content,pro_id) values(NULL,'".$_POST['title']."','".$_POST['content']."','".$_POST['pro_id']."')") or die(mysql_error());
        echo 'News Created';
        header("Location:../news?y=y");
        break;

    case 'update':
        mysql_query("update salus_news set title='".$_POST['title']."', content='".$_POST['content']."',pro_id = '".$_POST['pro_id']."' where sr='".$_POST['sr']."'  ") or die(mysql_error());
        header("Location:../news?y=u");
        break;
    
    
    default:
        break;
}

?>
